Skip to content

Fix RGB JPEG embedded as DeviceGray (0.19.0 regression)#1734

Merged
blikblum merged 3 commits into
masterfrom
copilot/fix-regression-issue-0-19-0
Jun 9, 2026
Merged

Fix RGB JPEG embedded as DeviceGray (0.19.0 regression)#1734
blikblum merged 3 commits into
masterfrom
copilot/fix-regression-issue-0-19-0

Conversation

Copilot AI commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

An incorrect lint autofix in 38dd4359a changed this.data[pos++] to this.data[pos + 1] instead of the correct this.data[pos] when reading the component count from a JPEG SOF segment. This caused all standard RGB JPEGs to be labeled DeviceGray (component id 1) instead of DeviceRGB (component count 3), rendering them grayscale.

Changes

  • lib/image/jpeg.js: Correct the byte offset — read this.data[pos] (the Nf component-count byte) instead of this.data[pos + 1] (the first component's identifier).
  • tests/unit/image.spec.js: Add regression test asserting that a standard RGB JPEG parses with colorSpace === 'DeviceRGB'.

Copilot AI changed the title [WIP] Fix regression in RGB JPEGs rendering as DeviceGray Fix RGB JPEG embedded as DeviceGray (0.19.0 regression) Jun 9, 2026
Copilot AI requested a review from blikblum June 9, 2026 18:11
@blikblum

blikblum commented Jun 9, 2026

Copy link
Copy Markdown
Member

@copilot discard yarn lock file changes

Copilot AI commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

@copilot discard yarn lock file changes

Done — reverted the yarn.lock changes in 3df0d1e.

@blikblum blikblum marked this pull request as ready for review June 9, 2026 18:38
@blikblum blikblum merged commit b5b2547 into master Jun 9, 2026
6 checks passed
@blikblum blikblum deleted the copilot/fix-regression-issue-0-19-0 branch June 9, 2026 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression in 0.19.0: RGB JPEGs embedded as DeviceGray (rendered grayscale)

2 participants